package com.vids.alarm;


import java.io.IOException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 线程池用到的自定义策略
 */
public class MyRejected implements RejectedExecutionHandler {

    public MyRejected() throws IOException {
    }
    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        System.out.println("任务过多!!!");
        System.out.println("当前被拒绝任务为：" + r.toString());
    }

}
